[Cmake-commits] [cmake-commits] hoffman committed CMakeLists.txt NONE 1.1.2.2 bar.c NONE 1.1.2.2 foo.c NONE 1.1.2.2

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Sep 3 09:43:30 EDT 2008


Update of /cvsroot/CMake/CMake/Tests/Dependency/Case4
In directory public:/mounts/ram/cvs-serv18450/Tests/Dependency/Case4

Added Files:
      Tag: CMake-2-6
	CMakeLists.txt bar.c foo.c 
Log Message:
ENH: 2.6.2 rc 2 merge from main tree


--- NEW FILE: CMakeLists.txt ---
project(CASE4 C)

IF(CMAKE_ANSI_CFLAGS)
  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
ENDIF(CMAKE_ANSI_CFLAGS)

# This is not really a circular dependency.  "case4Bar" refers to a
# third-party library that happens to match the executable name, which
# is okay when the executable is not a linkable target (ENABLE_EXPORTS
# is not set).  This tests whether CMake avoids incorrectly reporting
# a circular dependency.  In practice case4Foo may be a shared
# library, but we skip that here because we do not want it to actually
# have to find the third-party library.
add_library(case4Foo STATIC foo.c)
target_link_libraries(case4Foo case4Bar)

# The executable avoids linking to a library with its own name, which
# has been a CMake-ism for a long time, so we will not get a link
# failure.  An imported target or executable with an OUTPUT_NAME set
# may be used if the user really wants to link a third-party library
# into an executable of the same name.
add_executable(case4Bar bar.c)
target_link_libraries(case4Bar case4Foo)

--- NEW FILE: foo.c ---
int foo() { return 0; }

--- NEW FILE: bar.c ---
extern int foo();
int main() { return foo(); }



More information about the Cmake-commits mailing list